package action.article;

import service.ArticleService;
import bean.Article;

import com.opensymphony.xwork2.ActionSupport;

public class ModifyArticleAction extends ActionSupport {
	private Article article;
	private ArticleService articleService;
	@Override
	public String execute() throws Exception {
		Article a=articleService.getArticleById(article.getId());
		a.setTitle(article.getTitle());
		a.setContent(article.getContent());
		a.setArticleClass(article.getArticleClass());
		System.out.println(a.getContent());
		if(articleService.modifyArticle(a))
			return SUCCESS;
		return INPUT;
	}
	public Article getArticle() {
		return article;
	}
	public void setArticle(Article article) {
		this.article = article;
	}
	public ArticleService getArticleService() {
		return articleService;
	}
	public void setArticleService(ArticleService articleService) {
		this.articleService = articleService;
	}
	
	
}
